package com.sharkburner.aeris.ui.module.appNavigation.model;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.vaadin.ui.VerticalLayout;

@Component
public class NavigationFactory {

	@Autowired
	private BeanFactory beanFactory;

	public VerticalLayout getBodyLayout(String menu) {
		if (NavigationMenu.MENU_RSS.equalsIgnoreCase(menu)) {
			return (VerticalLayout) beanFactory.getBean("articleLayout");
		} else if (NavigationMenu.MENU_SITE.equalsIgnoreCase(menu)) {
			return (VerticalLayout) beanFactory.getBean("siteLayout");
		}

		return null;
	}
}
